<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	if(session.getAttribute("admin") == null) {
		response.sendRedirect("Login.jsp");
	}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<table border="1">
		<tr>
			<th>商品id</th>
			<th>商品名</th>
			<th>商品工厂</th>
			<th>商品类型</th>
			<th>商品价格</th>
			<th>商品数量</th>
			<th>操作</th>
		</tr>
		<c:forEach var="goods" items="${page.data}">
			<tr>
				<td>${goods.id}</td>
				<td>${goods.goodsName}</td>
				<td>${goods.goodsFactory}</td>
				<td>${goods.goodsType}</td>
				<td>${goods.goodsPrice}</td>
				<td>${goods.goodsNum}</td>
				<td><a href="deleteGoods.do?id=${goods.id}">删除</a></td>
			<tr>
		</c:forEach>
	</table>
	<div>
		<c:if test="${page.hasPrev}">
			<a href="goods.do?pageNum=${page.pageNum-1}">上一页</a>
		</c:if>
		<c:forEach items="${page.totalPageNum }" var="p">
			<a href="goods.do?pageNum=${p }">${p }</a>
		</c:forEach>
		<c:if test="${page.hasNext }">
			<a href="goods.do?pageNum=${page.pageNum+1}">下一页</a>
		</c:if>
	</div>
</body>
</html>